﻿@model WebApp.ViewModels.Manage.LangResEditModel

@{
    Layout = "~/Views/Shared/_DialogLayout.cshtml";
}

@using (Html.BeginForm("", "", FormMethod.Post, new { @class = "form-horizontal form-inline", id = "inputform" }))
{
    <div class="dialog-content">
        @Html.AntiForgeryToken()
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })

        <input type="hidden" id="Id" value="@Model.Id" class="form-control datafield" data-fieldname="Id" />

        <div class="row">
            <div class="col-xs-12 nopadding">
                <div class="widget-box">
                    <div class="widget-title">
                        <h5>资源描述</h5>
                    </div>
                    <div class="widget-content">
                        <table cellpadding="3" cellspacing="0" border="0" class="inputform">
                            <tr>
                                <td class="td-label"><label for="Rescategory">分类</label></td>
                                <td class="td-control">
                                    @Html.WYCombo("Rescategory", "", @Model.Rescategory, "value", ViewBag.RescategoryList as SelectList, new { @class = "form-control datafield", @data_fieldname = "Rescategory" })
                                </td>
                                <td class="td-label-left" style="width:200px;">
                                    <label style="color:#999;">（自定义分类，便于查询）</label>
                                </td>
                            </tr>
                            <tr>
                                <td class="td-label"><label for="Resname">资源名称</label></td>
                                <td class="td-control" style="width:300px;">
                                    @Html.TextBox("Resname", @Model.Resname, new { @class = "form-control datafield", @data_fieldname = "Resname" })
                                </td>
                                <td class="td-label-left" style="width:200px;">
                                    <label style="color:#999;"></label>
                                </td>
                            </tr>
                            <tr>
                                <td class="td-label"><label for="Reskey">Key(唯一键)</label></td>
                                <td class="td-control">
                                    @Html.TextBox("Reskey", @Model.Reskey, new { @class = "form-control datafield", @data_fieldname = "Reskey" })
                                </td>
                                <td class="td-label-left" style="width:200px;">
                                    <label style="color:#999;">（分隔符请使用下划线）</label>
                                </td>
                            </tr>
                            <tr>
                                <td class="td-label"></td>
                                <td class="td-control">
                                    <div data-form="checkbox">
                                        <label class="checkbox">
                                            @Html.CheckBox("Resjs", @Model.Resjs == 1 ? true : false, new { @class = "datafield", @data_fieldname = "Resjs" }) JS资源
                                        </label>
                                    </div>
                                </td>
                            </tr>
                        </table>
                        <hr style="margin:5px;" />
                        <table class="table table-condensed responsive grid-edit" id="list_table">
                            <thead>
                                <tr>
                                    <td width="200">语言</td>
                                    <td>值</td>
                                </tr>
                            </thead>
                            <tbody class="list-template hidden"></tbody>
                            <tbody class="list-data">
                                @foreach (var content in Model.ContentList)
                                {
                                    <tr>
                                        <td>
                                            @Html.Hidden("Lang_" + content.Lang, @content.Lang, new { @class = "form-control datafield", @data_fieldname = "Lang" })
                                            @Html.TextBox("Langname_" + content.Lang, @content.Langname, new { @class = "form-control datafield", @data_fieldname = "Lang", @disabled = "disabled" })
                                        </td>
                                        <td>
                                            @Html.TextBox("Rescontent_" + content.Lang, @content.Content, new { @class = "form-control datafield require", @data_fieldname = "Rescontent" })
                                        </td>
                                    </tr>
                                }
                            </tbody>
                            <tbody class="list-del hidden"></tbody>
                        </table>

                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="dialog-footer">
        <button id="btncancel" class="btn btn-small btn-default">取消</button>
        <button id="btnsave" class="btn btn-small btn-primary">保存</button>
    </div>
}

@section scripts{
    <script type="text/javascript" src="~/Scripts/lang_zh_cn2hk.js"></script>
    <script type="text/javascript" src="~/Scripts/app/manage/langres.edit.js?ver=@WebApp.BLL.CommonStr.Ver"></script>
}